package com.manbas.zhg.manbas.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.manbas.zhg.R;
import com.manbas.zhg.manbas.global.BaseActivity;
import com.zhy.autolayout.AutoLinearLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2016/11/17.
 */

public class MainTabActivity extends BaseActivity {
    @BindView(R.id.iv_area)
    ImageView iv_area;
    @BindView(R.id.tv_area)
    TextView tv_area;
    @BindView(R.id.tv_tabEmployee)
    TextView tv_tabEmployee;
    @BindView(R.id.tv_tabEmployer)
    TextView tv_tabEmployer;
    @BindView(R.id.tv_map)
    TextView tv_map;
    @BindView(R.id.layout_home)
    AutoLinearLayout layout_home;
    @BindView(R.id.layout_mine)
    AutoLinearLayout layout_mine;
    @BindView(R.id.tv_home)
    TextView tv_home;
    @BindView(R.id.tv_mine)
    TextView tv_mine;
    @BindView(R.id.iv_home)
    ImageView iv_home;
    @BindView(R.id.iv_mine)
    ImageView iv_mine;
    @BindView(R.id.iv_publish)
    ImageView iv_publish;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetLayout(R.layout.main_tab_activity);
        ButterKnife.bind(this);
    }

    private void setTabBottombase(){
        iv_home.setImageResource(R.mipmap.home_gray);
        tv_home.setTextColor(getResources().getColor(R.color.text_gray_03));
        iv_mine.setImageResource(R.mipmap.mine_gray);
        tv_mine.setTextColor(getResources().getColor(R.color.text_gray_03));
    }

    @Override
    @OnClick({R.id.iv_area,R.id.tv_area,R.id.tv_tabEmployer,R.id.tv_tabEmployee,R.id.tv_map,R.id.layout_home,R.id.layout_mine,R.id.iv_publish})
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.iv_area:
            case R.id.tv_area:
                break;
            case R.id.tv_tabEmployee:
                tv_tabEmployee.setTextColor(getResources().getColor(R.color.text_black_01));
                tv_tabEmployer.setTextColor(getResources().getColor(R.color.white));
                tv_tabEmployer.setBackgroundResource(R.color.no_color);
                tv_tabEmployee.setBackgroundResource(R.drawable.shap_white_blue);
                break;
            case R.id.tv_tabEmployer:
                tv_tabEmployee.setTextColor(getResources().getColor(R.color.white));
                tv_tabEmployer.setTextColor(getResources().getColor(R.color.text_black_01));
                tv_tabEmployer.setBackgroundResource(R.drawable.shap_white_blue);
                tv_tabEmployee.setBackgroundResource(R.color.no_color);
                break;
            case R.id.tv_map:
                break;
            case R.id.layout_home:
                setTabBottombase();
                iv_home.setImageResource(R.mipmap.home_b);
                tv_home.setTextColor(getResources().getColor(R.color.base_theme));
                break;
            case R.id.layout_mine:
                setTabBottombase();
                iv_mine.setImageResource(R.mipmap.mine_blue);
                tv_mine.setTextColor(getResources().getColor(R.color.base_theme));
                break;
            case R.id.iv_publish:
                break;

        }
    }
}
